package cn.lzy.study.datasource.service;

import cn.lzy.study.datasource.annotation.DataSource;
import cn.lzy.study.datasource.entity.User;
import cn.lzy.study.datasource.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    @DataSource("slave")
    public List<User> getAllUser() {
        return userMapper.getAllUser();
    }


    public List<User> getAllUser2() {
        return userMapper.getAllUser();
    }

}
